﻿namespace com.IronOne.BoardPACWinAppUtil.Util
{
    public class Global
    {
        /// <summary>
        ///     Value assigned in Login page
        /// </summary>
        public static int UserId { get; set; }

        /// <summary>
        ///     Value assigned in Login page
        /// </summary>
        public static string Username { get; set; }

        /// <summary>
        ///     Value assigned in Login page
        /// </summary>
        public static string Password { get; set; }

        /// <summary>
        ///     Value assigned in Login page; LoginProcess()
        /// </summary>
        public static bool IsFirstTime { get; set; }

        /// <summary>
        ///     Value assigned in 3 places.
        ///     XmlToModelMapper's LogOnModelMapper method
        ///     AuthDAO LogOnOffline()
        ///     ProfileUserControlViewModel's GetProfileDataModel method
        /// </summary>
        public static string IPadDisplayName { get; set; }

        /// <summary>
        ///     Value assigned in class SplashPage
        ///     2 places when system is online and offline
        /// </summary>
        public static string DateFormat { get; set; }

        /// <summary>
        ///     Value assigned in Meetings page's GetMeetings()
        /// </summary>
        public static bool IsBoardSecrartary { get; set; }

        /// <summary>
        ///     Value assigned in ProfileUserControlViewModel
        ///     Initialized in SplashPage constructor
        /// </summary>
        public static bool IsOnline { get; set; }

        /// <summary>
        ///     Value assigned in ProfileUserControlViewModel and Login Page's OfflineLogin()
        ///     Initialized in SplashPage constructor, and GoOnlineCommon() on LoginPage
        /// </summary>
        public static bool UserForceWentOffline { get; set; }

        /// <summary>
        ///     Values asingned in Agenda page NavigateTo andFrom methods only.
        ///     Paper downloading and paending status will broadcast only if user in agenda page
        /// </summary>
        public static bool IsOnAgendaPage { get; set; }

        /// <summary>
        ///     Values asingned in Splash page CommonFunc()
        /// </summary>
        public static string CooperateId { get; set; }

        /// <summary>
        ///     Values asingned in Splash page CommonFunc()
        /// </summary>
        public static string ServerUrl { get; set; }

        public static void CleanUp()
        {
            UserId = 0;
            Username = null;
            Password = null;
            IsFirstTime = false;
            IPadDisplayName = null;
            IsBoardSecrartary = false;
            //IsOnline = true;  //Let the app handle this
            UserForceWentOffline = false;
            IsOnAgendaPage = false;
            //CooperateId = "";  //Let the app handle this
            //ServerUrl = "";  //Let the app handle this
        }
    }
}